<%@ Page Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="CheckStatus.aspx.cs" Inherits="Pages_Customer_CheckStatus" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"><div class="header">Check your delivery's status</div><br /><br /><table border="1" class="table01"><tr><td colspan="3" style="text-align: center; background-color: #a9c0f2" class="smallheader">Enter your information here </td></tr><tr><td>Delivery Number: </td><td><asp:TextBox ID="txtDeliveryNumber" runat="server" width="150px"></asp:TextBox> </td><td style="width: 53px"><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Delivery Number cannot be blank" controltovalidate="txtDeliveryNumber">*</asp:RequiredFieldValidator> 
    <asp:RegularExpressionValidator ID="regDeliveryID" runat="server" ControlToValidate="txtDeliveryNumber"
        ErrorMessage="Delivery Number must be a positive integer" ValidationExpression="^[1-9][0-9]*$">*</asp:RegularExpressionValidator></td></tr><tr><td>Contact Number: </td><td><asp:TextBox ID="txtContactNumber" runat="server" textmode="Password" width="150px"></asp:TextBox> </td><td style="width: 53px"><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Contact Number cannot be blank" controltovalidate="txtContactNumber">*</asp:RequiredFieldValidator> </td></tr><tr><td colspan="3" style="text-align: center"><asp:Button ID="btnTrack" runat="server" Text="Track & Confirm" OnClick="btnTrack_Click" />&nbsp;</td></tr></table>
    <br />
    <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label><br />
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" />
    <br />
    <asp:DetailsView ID="dtvStatus" runat="server" DataSourceID="SqlDataSource1" Height="50px"
        Width="300px" BorderColor="#556CB0" AutoGenerateRows="False">
        <AlternatingRowStyle BackColor="Gainsboro" />
        <Fields>
            <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" />
            <asp:BoundField DataField="Service" HeaderText="Service" ReadOnly="True" SortExpression="Service" />
            <asp:BoundField DataField="CustomerName" HeaderText="Sender" ReadOnly="True"
                SortExpression="CustomerName" />
            <asp:BoundField DataField="ReceiverName" HeaderText="Receiver" SortExpression="ReceiverName" />
            <asp:BoundField DataField="ReceiverAddress" HeaderText="Address" SortExpression="ReceiverAddress" />
            <asp:CheckBoxField DataField="Delivered" HeaderText="Delivered" SortExpression="Delivered" />
        </Fields>
    </asp:DetailsView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TarsConnection %>"
        ProviderName="System.Data.SqlClient" SelectCommand="select Type, (select ServiceName from Services where ServiceID = Deliverables.ServiceID) as Service, (select FullName from Customers where CustomerID = Deliverables.CustomerID) as CustomerName, Status as Delivered, ReceiverName, ReceiverAddress from Deliverables where DeliverableID = @DeliverableID">
        <SelectParameters>
            <asp:Parameter Name="DeliverableID" />
        </SelectParameters>
    </asp:SqlDataSource>
</asp:Content>

